package demo;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Administrator
 * Date: 2023-03-29
 * Time: 14:19
 */
class Washer{
    private String name;
    private int weight;

    public Washer(String name, int weight) {
        this.name = name;
        this.weight = weight;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getWeight() {
        return weight;
    }

    public void setWeight(int weight) {
        this.weight = weight;
    }
    public void brand(){
        System.out.println("品牌"+name+"重量"+weight);
    }
}

class Cygnet extends Washer{

    public Cygnet(String name, int weight) {
        super(name, weight);
    }

    @Override
    public void brand(){
        System.out.println("品牌"+super.getName()+"    重量"+super.getWeight()+"kg");
    }

}

class Medi extends Washer{

    public Medi(String name, int weight) {
        super(name, weight);
    }
    @Override
    public void brand(){
        System.out.println("品牌"+super.getName()+"    重量"+super.getWeight()+"kg");
    }
}


public class Test {
    public static void Lundry(Washer washer){
        washer.brand();
    }
    public static void main(String[] args) {
/*        Cygnet cygnet1 = new Cygnet("小天鹅",20);
        cygnet1.brand();
        Cygnet cygnet2 = new Cygnet("美的",18);
        cygnet2.brand();*/
        Lundry(new Medi("小七",16));
    }
}
